#ifndef _LEARNCLASSES_HPP_
#define _LEARNCLASSES_HPP_
#include "vectclasses.hpp"

class StepChangeLaw
{
public:
	virtual double getNextValue() = 0;
};

class StepChangeLawExp : public StepChangeLaw
{
private:
    int myT;
    double myP;
public:
    StepChangeLawExp(double param) : myT(0), myP(param)
    {
    }
    double getNextValue()
    {
        return exp(-myP*(myT++));
    }
};

class StepChangeLawLinear : public StepChangeLaw
{
private:
    int myT;
    double myStart;
    double myIncr;
public:
    StepChangeLawLinear(double x, double v) : myT(0), myStart(x), myIncr(v)
    {
    }
    double getNextValue()
    {
        return myStart + myIncr*(myT++);
    }
};

class LearningMethod
{
public:
	virtual void learn(VectorArray & vectors, VectorArray & classes) = 0;
};

class LearningMethodCCM : public LearningMethod
{
private:
    StepChangeLaw * myStep;
    StepChangeLaw * myAlpha;
public:
	LearningMethodCCM(StepChangeLaw & step, StepChangeLaw & alpha)
	{
		myStep = &step;
		myAlpha = &alpha;
	}
	void learn(VectorArray & vectors, VectorArray & classes);
};

class LearningMethodSimple : public LearningMethod
{
private:
    StepChangeLaw * myStep;
public:
	LearningMethodSimple(StepChangeLaw & step)
	{
		myStep = &step;
	}
	void learn(VectorArray & vectors, VectorArray & classes);
};

#endif
